home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / TEECHART / Src Code / CHARTEXP.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-10-24  |  3.2 KB  |  169 lines

  1. {**********************************************}
  2. {   TeeChart Wizard                            }
  3. {   Copyright (c) 1996-98 by David Berneda     }
  4. {**********************************************}
  5. {$I teedefs.inc}
  6. unit ChartExp;
  7.  
  8. interface
  9.  
  10. uses
  11. {  ShareMem, }
  12.   Forms,
  13.   Windows,
  14.   ExptIntf,
  15.   ToolIntf,
  16.   VirtIntf,
  17.   SysUtils,
  18.   ExpForm,
  19.   TeeConst;
  20.  
  21. type
  22.   TTeeChartWizard = class(TIExpert)
  23.     function GetName: string; override;
  24.     function GetAuthor: string; override;
  25.     function GetComment: string; override;
  26.     function GetGlyph: HICON; override;
  27.     function GetStyle: TExpertStyle; override;
  28.     function GetState: TExpertState; override;
  29.     function GetIDString: string; override;
  30.     function GetPage: string; override;
  31.     procedure Execute; override;
  32.     function GetMenuText: string; override;
  33.   end;
  34.  
  35. Procedure Register;
  36.  
  37. implementation
  38.  
  39. {$R CHAEXPER.RES}
  40.  
  41. procedure HandleException;
  42. begin
  43.   ToolServices.RaiseException(ReleaseException);
  44. end;
  45.  
  46. { TTeeChartWizard }
  47. function TTeeChartWizard.GetName: string;
  48. begin
  49.   try
  50.     Result := TeeMsg_TeeChartWizard ;
  51.   except
  52.     HandleException;
  53.   end;
  54. end;
  55.  
  56. function TTeeChartWizard.GetComment: string;
  57. begin
  58.   try
  59.     Result :=  TeeMsg_TeeChartWizard ;
  60.   except
  61.     HandleException;
  62.   end;
  63. end;
  64.  
  65. function TTeeChartWizard.GetGlyph: HICON;
  66. begin
  67.   result:=0;
  68.   try
  69.     Result := LoadIcon(HInstance, 'TEEEXPICON');
  70.   except
  71.     HandleException;
  72.   end;
  73. end;
  74.  
  75. function TTeeChartWizard.GetStyle: TExpertStyle;
  76. begin
  77.   Result := esForm;
  78.   try
  79.     Result := esForm;
  80.   except
  81.     HandleException;
  82.   end;
  83. end;
  84.  
  85. function TTeeChartWizard.GetState: TExpertState;
  86. begin
  87.   try
  88.     Result := [esEnabled];
  89.   except
  90.     HandleException;
  91.   end;
  92. end;
  93.  
  94. function TTeeChartWizard.GetIDString: string;
  95. begin
  96.   try
  97.     Result :=  TeeMsg_TeeMachWizard ;
  98.   except
  99.     HandleException;
  100.   end;
  101. end;
  102.  
  103. function TTeeChartWizard.GetAuthor: string;
  104. begin
  105.   try
  106.     Result := TeeMsg_TeeMachSL ;
  107.   except
  108.     HandleException;
  109.   end;
  110. end;
  111.  
  112. function TTeeChartWizard.GetPage: string;
  113. begin
  114.   try
  115.     Result :=  TeeMsg_WizardTab ;
  116.   except
  117.     HandleException;
  118.   end;
  119. end;
  120.  
  121. procedure TTeeChartWizard.Execute;
  122. begin
  123.   try
  124.     TeeChartWizard(ToolServices);
  125.   except
  126.     HandleException;
  127.   end;
  128. end;
  129.  
  130. function TTeeChartWizard.GetMenuText: string;
  131. begin
  132.   result:='';
  133. end;
  134.  
  135. procedure DoneWizard; export;
  136. begin
  137.   { Put any general destruction code here.  Note that the Delphi IDE
  138.     will destroy any Wizards which have been registered. }
  139. end;
  140.  
  141. function InitWizard(ToolServices: TIToolServices;
  142.   RegisterProc: TExpertRegisterProc;
  143.   var Terminate: TExpertTerminateProc): Boolean; export; stdcall;
  144. begin
  145. {$IFDEF D3}
  146.   result:=True;
  147. {$ELSE}
  148.   { make sure we are the first and only instance }
  149.   Result := ExptIntf.ToolServices = nil;
  150.   if not Result then Exit;
  151. {$ENDIF}
  152.  
  153.   ExptIntf.ToolServices := ToolServices;
  154.   if ToolServices <> nil then
  155.     Application.Handle := ToolServices.GetParentHandle;
  156.  
  157.   Terminate := DoneWizard;
  158.  
  159.   { register the Wizards }
  160.   RegisterProc(TTeeChartWizard.Create);
  161. end;
  162.  
  163. Procedure Register;
  164. begin
  165.   RegisterLibraryExpert(TTeeChartWizard.Create);
  166. end;
  167.  
  168. end.
  169.